import request from '../utils/request'

export const getArticleList = (current, size, title, status) => {
    return request({
        url: '/article/article/search',
        method: 'POST',
        data: {
            current, 
            size,
            title,
            status
        }
    })
}



export const delArticle = (id) => {
    return request({
        url: `/article/article/${id}`,
        method: 'DELETE',
    })
}


export const searchArticle = (id) => {
    return request({
        url: `/article/article/${id}`,
        method: 'GET',
    })
}


export const getCategoryList = (current, size, name, status) => {
    return request({
        url: '/article/category/search',
        method: 'POST',
        data: {
            current, 
            size,
            name,
            status
        }
    })
}


export const delCategory = (id) => {
    return request({
        url: `/article/category/${id}`,
        method: 'DELETE',
    })
}


export const searchCategory = (id) => {
    return request({
        url: `/article/category/${id}`,
        method: 'GET',
    })
}


export const addCategory = (data) => {
    return request({
        url: '/article/category',
        method: 'POST',
        data
    })
}


export const editCategory = (data) => {
    return request({
        url: '/article/category',
        method: 'PUT',
        data
    })
}



export const getLabelList = (page, size, name, categoryId) => {
    return request({
        url: '/article/label/search',
        method: 'POST',
        data: {
            page, 
            size, 
            name, 
            categoryId
        }
    })
}

